#include "local_dns_util.h"

#include <stdio.h>

#include "dns_packet_parsing.h"

void extract_remote_info(char * message, char remote_addr_str[16], int * remote_port) {
	unsigned char ipv4_addr[4];
	ns_ip_from_add_section(message, ipv4_addr);
	sprintf(remote_addr_str, "%u.%u.%u.%u", ipv4_addr[0], ipv4_addr[1], ipv4_addr[2], ipv4_addr[3]);
	*remote_port = ipv4_addr[0] * ipv4_addr[3];
}
